import { APPConfig } from '@/models/sys'
import { defineStore } from 'pinia'
import { ref } from 'vue'

const initState: APPConfig = {
  refresh_interval: 10,
}

export const configAppStore = defineStore('config', () => {
  const config = ref<APPConfig>({ ...initState })

  function setConfig(val: APPConfig) {
    config.value = { ...val }
  }

  return {
    config,
    setConfig,
  }
})
